package com.linewell.dao.impl;

import com.linewell.dao.CommentMapper;
import com.linewell.entity.Reply;
import com.linewell.entity.ReplyVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Title: ssm2
 * @description:
 * @author: hyuhuang@linewell.com
 * @since:2018/2/21
 */
@Repository
public class CommentDao implements CommentMapper {

    @Autowired
    private CommentMapper commentMapper;


    public void insertComment(long id ,long articleId, long articleUserId) {
        commentMapper.insertComment(id,articleId,articleUserId);
    }


    public List<Reply> getReply(long articleId,int page) {
        return commentMapper.getReply(articleId,page);
    }

    public void insertReply(Reply reply) {
        commentMapper.insertReply(reply);
    }

    public List<Reply> getCommentByUserId(long userId, int page) {
        return commentMapper.getCommentByUserId(userId,page);
    }

    public boolean deleteComment(long replyId) {
        return commentMapper.deleteComment(replyId);
    }

    public Reply godComment(long articleId) {
        return commentMapper.godComment(articleId );
    }

    public List<Reply> getHotReply(int page) {
        return commentMapper.getHotReply(page);
    }

    public List<Reply> getReplyFromReply(Long replyId) {
        return commentMapper.getReplyFromReply(replyId);
    }

    public int getReplyCount() {
        return commentMapper.getReplyCount();
    }

    public List<ReplyVo> getReplyList(int page, int limit) {
        return commentMapper.getReplyList(page,limit);
    }

    public void updataReplyCheck(Long replyId) {
        commentMapper.updataReplyCheck(replyId);
    }

    public boolean deleteReplyByReplyId(Long replyId) {
        return commentMapper.deleteReplyByReplyId(replyId);
    }

    public boolean updataAllReply(String replyIds) {
        return commentMapper.updataAllReply(replyIds);
    }
}
